package com.javabasic.algorithm.cometoj;

import java.util.Scanner;

public class 鱼目混珠 {
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        int n = cin.nextInt();
        int result = 0;
        String str = null;
        while (n-- > 0) {
            str = cin.next();
            if (str.endsWith("acpty")) {
                result ++ ;
            }
        }
        System.out.println(result);

    }
}
